#include "DataStructure/Common/Real.h"
#include "Gauss2DTria6P.h"

using SG::DataStructure::Common::Real;
using namespace SG::FEMSolver::Element;

std::size_t Gauss2DTria6P::nPoint = 6;

Gauss2DTria6P::Gauss2DTria6P()
    : integPointSet(nPoint)
{
    // 权重和为1/2
    const Real w1 = 0.109951743655322 / 2.0;
    const Real w2 = 0.223381589678011 / 2.0;

    integPointSet[0].m_x = 0.816847572980459;
    integPointSet[0].m_y = 0.091576213509771;
    integPointSet[0].m_z = 0.0;
    integPointSet[0].m_weight = w1;

    integPointSet[1].m_x = 0.091576213509771;
    integPointSet[1].m_y = 0.816847572980459;
    integPointSet[1].m_z = 0.0;
    integPointSet[1].m_weight = w1;

    integPointSet[2].m_x = 0.091576213509771;
    integPointSet[2].m_y = 0.091576213509771;
    integPointSet[2].m_z = 0.0;
    integPointSet[2].m_weight = w1;

    integPointSet[3].m_x = 0.108103018168070;
    integPointSet[3].m_y = 0.445948490915965;
    integPointSet[3].m_z = 0.0;
    integPointSet[3].m_weight = w2;

    integPointSet[4].m_x = 0.445948490915965;
    integPointSet[4].m_y = 0.108103018168070;
    integPointSet[4].m_z = 0.0;
    integPointSet[4].m_weight = w2;

    integPointSet[5].m_x = 0.445948490915965;
    integPointSet[5].m_y = 0.445948490915965;
    integPointSet[5].m_z = 0.0;
    integPointSet[5].m_weight = w2;
}

std::size_t Gauss2DTria6P::GetPointSize() const { return Gauss2DTria6P::nPoint; }
const SG::DataStructure::FEM::IntegPoint& Gauss2DTria6P::GetPoint(std::size_t index) const { return integPointSet[index]; }
const SG::DataStructure::FEM::IntegPointArray& Gauss2DTria6P::GetPoints() const { return integPointSet; }